package com.yadang.stream;

import com.sun.deploy.util.StringUtils;

import java.util.Objects;

/**
 * @author: 亚当
 * @date: 2023年04月11日 21:44
 * @package: com.yadang.stream
 * @Description: TODO
 */
public class Product {
    private String name;
    private String price;
    private String date;
    private String colour;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPrice() {
        return price;
    }

    public void setPrice(String price) {
        this.price = price;
    }

    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }

    public String getColour() {
        return colour;
    }

    public void setColour(String colour) {
        this.colour = colour;
    }

    @Override
    public String toString() {
        return "Product{" +
                "name='" + name + '\'' +
                ", price='" + price + '\'' +
                ", date='" + date + '\'' +
                ", colour='" + colour + '\'' +
                '}';
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, price, date, colour);
    }

    @Override
    public boolean equals(Object o) {
        if (o == this) return true;
        if (!(o instanceof Product)) return false;
        Product other = (Product) o;
        return Objects.equals(name, other.name)
                && Objects.equals(price, other.price)
                && Objects.equals(date, other.date)
                && Objects.equals(colour, other.colour);
    }
}
